home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / comm / tm420_1.zip / HOST.EXE / HCONFIG.SCR next >
Text File  |  1995-06-14  |  7KB  |  244 lines

  1. ;
  2. ; HCONFIG.SCR by White River Software, 1 May, 1995
  3. ;
  4.  
  5. integer NEWUSERLEVEL, SYSOPLEVEL, DETECTBAUD, INITIALBAUD, YELLTIME, YELLSOUND, CLOSESYSTEM
  6. string HOSTDIR, DOWNLOADDIR, UPLOADDIR, COMPORT
  7. integer pos, finish, baud
  8. string ch, ss
  9.  
  10. NEWUSERLEVEL = 1             ; new user level
  11. SYSOPLEVEL = 2               ; sysop level
  12. DETECTBAUD = 1               ; set to 0 if COM baud rate is locked
  13. query baud,INITIALBAUD       ; initial baud rate (highest baud rate)
  14. YELLTIME = 3                 ; amount of time to display the alarm
  15. YELLSOUND = 1                ; amount of time to ring the alarm
  16. query dirtelemate,HOSTDIR    ; directory holding *.HST
  17. query dirupload,DOWNLOADDIR  ; host download directory
  18. query dirdownload,UPLOADDIR  ; host upload directory
  19. CLOSESYSTEM = 0              ; set to 1 if close system
  20.  
  21. COMPORT = "1"
  22.  
  23.    procedure Pause
  24.    string ch
  25.    print
  26.    print "Press [Enter] to continue ",
  27.    repeat
  28.       inputch ch
  29.    until success
  30.    print
  31.    print
  32.    endproc
  33.  
  34. open "HSHELL.BAT"            ; [S]hell batch file
  35. if not success
  36.    print
  37.    print
  38.    print "Which COM port is your modem connected to  (1-8) ?   COM",
  39.    repeat
  40.      inputch COMPORT
  41.      if success
  42.         print COMPORT
  43.         strpos "12345678",COMPORT,pos
  44.         if pos=0
  45.            print "Which COM port is your modem connected to  (1-8) ?   COM",
  46.         endif
  47.      endif
  48.    until success and pos>0
  49.    print
  50.    if COMPORT<>"1" and COMPORT<>"2"
  51.       print "Due to DOS limit, only COM1 and COM2 is supported for"
  52.       print "the [S]hell command in host mode.  However, you may"
  53.       print "create your own HSHELL.BAT and use a third-party program,"
  54.       print "such as DOORWAY, which allows you to use COM",COMPORT
  55.    else
  56.       create "HSHELL.BAT"
  57.       if success
  58.          print "Creating HSHELL.BAT, the batch file for [S]hell command"
  59.          write "CTTY COM",COMPORT
  60.          write "COMMAND"
  61.          write "CTTY CON"
  62.          write "EXIT"
  63.          close
  64.       else
  65.          print "Cannot to create HSHELL.BAT"
  66.       endif
  67.    endif
  68.    Pause
  69. else
  70.    close                     ; already exist, skip it
  71. endif
  72.  
  73. open "HCONFIG.HST"
  74. string s
  75. if success
  76.    read s
  77.    atoi s,NEWUSERLEVEL       ; new user level
  78.    read s
  79.    atoi s,SYSOPLEVEL         ; sysop level
  80.    read s
  81.    atoi s,DETECTBAUD         ; detect baud rate
  82.    read s
  83.    atoi s,INITIALBAUD        ; initial baud rate
  84.    read s
  85.    atoi s,YELLTIME           ; yell time
  86.    read s
  87.    atoi s,YELLSOUND          ; yell sound
  88.    read HOSTDIR              ; directory containing H*.HST
  89.    read DOWNLOADDIR          ; download directory
  90.    read UPLOADDIR            ; upload directory
  91.    read s
  92.    atoi s,CLOSESYSTEM        ; open or close system
  93.    close
  94. endif
  95.  
  96. finish = 0
  97. while not finish
  98.    clear text
  99.    print "A: New user level     : ",NEWUSERLEVEL
  100.    print "B: Sysop level        : ",SYSOPLEVEL
  101.    print "C: Detect baud rate   : ",
  102.    if DETECTBAUD
  103.       print "ON"
  104.    else
  105.       print "OFF"
  106.    endif
  107.    print "D: Initial baud rate  : ",INITIALBAUD
  108.    print "E: Yell time          : ",YELLTIME," seconds"
  109.    print "F: Yell sound         : ",YELLSOUND," seconds"
  110.    print "G: Host directory     : ",HOSTDIR
  111.    print "H: Download directory : ",DOWNLOADDIR
  112.    print "I: Upload directory   : ",UPLOADDIR
  113.    print "J: Close system       : ",
  114.    if CLOSESYSTEM
  115.       print "ON"
  116.    else
  117.       print "OFF"
  118.    endif
  119.    print
  120.    print "S: Save configuration and run host mode"
  121.    print "Q: Abort configuration"
  122.    print
  123.    print "Which option: ",
  124.    repeat
  125.       inputch ch
  126.    until success
  127.    print ch
  128.    print
  129.    print
  130.  
  131.    switch ch
  132.       case "A":
  133.          print "Enter new user level: ",
  134.          input s
  135.          ss = ""
  136.          concat ss,s
  137.          if ss<>""
  138.             atoi ss,NEWUSERLEVEL
  139.          endif
  140.       case "B":
  141.          print "Enter sysop level: ",
  142.          input s
  143.          ss = ""
  144.          concat ss,s
  145.          if ss<>""
  146.             atoi ss,SYSOPLEVEL
  147.          endif
  148.       case "C":
  149.          DETECTBAUD = not DETECTBAUD
  150.       case "D":
  151.          print "Enter initial baud rate: ",
  152.          input s
  153.          ss = ""
  154.          concat ss,s
  155.          if ss<>""
  156.             atoi ss,baud
  157.          endif
  158.          switch baud
  159.             case   300: INITIALBAUD = baud
  160.             case  1200: INITIALBAUD = baud
  161.             case  2400: INITIALBAUD = baud
  162.             case  4800: INITIALBAUD = baud
  163.             case  9600: INITIALBAUD = baud
  164.             case 19200: INITIALBAUD = baud
  165.             case 38400: INITIALBAUD = baud
  166.             otherwise : print
  167.                         print "Invalid value"
  168.                         print
  169.                         Pause
  170.          endswitch
  171.       case "E":
  172.          print "Enter yell time (0 to turn off): ",
  173.          input s
  174.          ss = ""
  175.          concat ss,s
  176.          if ss<>""
  177.             atoi ss,YELLTIME
  178.          endif
  179.       case "F":
  180.          print "Enter yell sound length (0 to turn off): ",
  181.          input s
  182.          ss = ""
  183.          concat ss,s
  184.          if ss<>""
  185.             atoi ss,YELLSOUND
  186.          endif
  187.       case "G":
  188.          print "Enter host directory which contains H*.HST: ",
  189.          input s
  190.          ss = ""
  191.          concat ss,s
  192.          if ss<>""
  193.             HOSTDIR = ss
  194.          endif
  195.       case "H":
  196.          print "Enter host download directory: ",
  197.          input s
  198.          ss = ""
  199.          concat ss,s
  200.          if ss<>""
  201.             DOWNLOADDIR = ss
  202.          endif
  203.       case "I":
  204.          print "Enter host upload directory: ",
  205.          input s
  206.          ss = ""
  207.          concat ss,s
  208.          if ss<>""
  209.             UPLOADDIR = ss
  210.          endif
  211.       case "J":
  212.      CLOSESYSTEM = not CLOSESYSTEM
  213.       case "S":
  214.          delete "HCONFIG.HST"
  215.          create "HCONFIG.HST"
  216.          if not success
  217.             print "Cannot create HCONFIG.HST"
  218.             print "Configuration aborted"
  219.             finish = 1
  220.          else
  221.             write NEWUSERLEVEL
  222.             write SYSOPLEVEL
  223.             write DETECTBAUD
  224.             write INITIALBAUD
  225.             write YELLTIME
  226.             write YELLSOUND
  227.             write HOSTDIR
  228.             write DOWNLOADDIR
  229.             write UPLOADDIR
  230.         write CLOSESYSTEM
  231.         close
  232.             print "Configuration completed"
  233.             Pause
  234.             print "Starting host mode"
  235.             script "HOST"
  236.          endif
  237.       case "Q":
  238.          print "Configuration aborted"
  239.          finish = 1
  240.    endswitch
  241. endwhile
  242.  
  243.  
  244.